package conf

import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// WxpaySection map toml [wxpay]
type WxpaySection struct {
	Host  string
	Port  string
}

// ReadWxpay get wxpay section from config
func ReadWxpay(v *viper.Viper, slog *zap.SugaredLogger) (wxpayConf WxpaySection) {
	err := v.Unmarshal(&wxpayConf)
	if err != nil {
		slog.Panicf("unable to decode into wxpay section, %v", err)
	}
	slog.Debug(wxpayConf)
	return
}
